package javase.collections;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class BinarySearchTest {
	public static void main(String[] args) {
		List<Integer> list = new ArrayList<Integer>();
		for (int i = 0; i < 10; i++) {
			list.add(10-i);
		}
		System.out.println("Collection: " + list);
		int searchTarget = 2;
		System.out.println("Search for " + searchTarget);
		int index = Collections.binarySearch(list, searchTarget);
		System.out.println("returned index " + index);
		
	}
}
